home *** CD-ROM | disk | FTP | other *** search
/ Aminet 5 / Aminet 5 - March 1995.iso / Aminet / util / wb / muispeak.lha / src / demo.h next >
C/C++ Source or Header  |  1994-07-30  |  2KB  |  87 lines

  1. #include <libraries/mui.h>
  2.  
  3. #include <dos/dos.h>
  4.  
  5. #include <graphics/gfxmacros.h>
  6.  
  7. #include <workbench/workbench.h>
  8.  
  9. #include <clib/alib_protos.h>
  10. #include <clib/exec_protos.h>
  11. #include <clib/dos_protos.h>
  12. #include <clib/icon_protos.h>
  13. #include <clib/graphics_protos.h>
  14. #include <clib/intuition_protos.h>
  15. #include <clib/gadtools_protos.h>
  16. #include <clib/utility_protos.h>
  17. #include <clib/asl_protos.h>
  18. #include <clib/muimaster_protos.h>
  19.  
  20. #include <stdlib.h>
  21. #include <string.h>
  22. #include <stdio.h>
  23.  
  24.  
  25. /* Compiler specific stuff */
  26.  
  27. #ifdef _DCC
  28.  
  29. #define REG(x) __ ## x
  30. #define ASM
  31. #define SAVEDS __geta4
  32.  
  33. #else
  34.  
  35. #define REG(x) register __ ## x
  36.  
  37.  
  38. #include <pragmas/exec_pragmas.h>
  39. #include <pragmas/dos_pragmas.h>
  40. #include <pragmas/icon_pragmas.h>
  41. #include <pragmas/graphics_pragmas.h>
  42. #include <pragmas/intuition_pragmas.h>
  43. #include <pragmas/gadtools_pragmas.h>
  44. #include <pragmas/utility_pragmas.h>
  45. #include <pragmas/asl_pragmas.h>
  46. #include <pragmas/muimaster_pragmas.h>
  47.  
  48. extern struct Library *SysBase,*IntuitionBase,*UtilityBase,*GfxBase,*DOSBase,*IconBase;
  49. struct Library *MUIMasterBase;
  50.  
  51. #endif
  52.  
  53.  
  54. /*************************/
  55. /* Init & Fail Functions */
  56. /*************************/
  57.  
  58. static VOID fail(APTR app,char *str)
  59. {
  60.     if (app)
  61.         MUI_DisposeObject(app);
  62.  
  63.     if (MUIMasterBase)
  64.         CloseLibrary(MUIMasterBase);
  65.  
  66.     exit(0);
  67. }
  68.  
  69.  
  70. #ifdef _DCC
  71.  
  72. int brkfunc(void) { return(0); }
  73.  
  74. #endif
  75.  
  76.  
  77.  
  78. static VOID init(VOID)
  79. {
  80.     onbreak(brkfunc);
  81.  
  82.     if (!(MUIMasterBase = OpenLibrary(MUIMASTER_NAME,MUIMASTER_VMIN)))
  83.         fail(NULL,"Failed to open "MUIMASTER_NAME".");
  84. }
  85.  
  86.  
  87.